<?php /* Smarty version 2.6.18, created on 2010-01-26 12:20:18
         compiled from documentLibrary.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'cycle', 'documentLibrary.tpl', 15, false),)), $this); ?>
<div id="main_content">
    	<h1>Document Library</h1>
            <div id="result">
				<div>
					<table border="0" width="100%">
						<tr><td colspan="4"><hr></td></tr>
						<tr>
							<td width="30%">Document Name</td>
							<td width="40%">Description</td>
							<td align="right">Date Uploaded</td>
							<td align="center">View</td>
						</tr>
						<tr><td colspan="4"><hr></td></tr>
						<?php $_from = $this->_tpl_vars['documents']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['document']):
?>
						<tr class="<?php echo smarty_function_cycle(array('values' => 'blue,notify'), $this);?>
">
							<td><?php echo $this->_tpl_vars['document']['title']; ?>
</td>
							<td><?php echo $this->_tpl_vars['document']['description']; ?>
</td>
							<td align="right"><?php echo $this->_tpl_vars['document']['date_uploaded']; ?>
</td>
							<td align="center" nowrap>
								<!-- <a href="<?php echo $this->_tpl_vars['document']['link']; ?>
"><?php if ($this->_tpl_vars['document']['map'] > 0): ?> View Map <?php else: ?> Download <?php endif; ?></a> -->
								<a href="http://<?php echo $this->_tpl_vars['request']; ?>
/<?php echo $this->_tpl_vars['document']['link']; ?>
" target="_top" ><?php if ($this->_tpl_vars['document']['map'] > 0): ?> View Map <?php else: ?> Show <?php endif; ?></a>
							</td>
						</tr>
						<?php endforeach; endif; unset($_from); ?>
						<tr class="blue">
							<td><label><b>FMA G.I.S. Map</b></label></td>
							<td></td>
							<td ></td>
							<td align="center"><input type="button" value="View Map" onclick="showMap()"></td>
						</tr>
					</table>
				</div>
            </div><!-- results -->
</div>
<script language="javascript">
<?php echo '
	function showDocument(fileName){
		doajaxAction("/account/showDocumentLibrary/fileName/"+fileName,0,"main_content");
	}
	function showMap() {
		map_window=window.open("/account/map",\'map\',\'height=618,width=818\');
		if (window.focus) {map_window.focus();}
	}
'; ?>

</script>